﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Rotempco.BaseClass.Objects.EntityObjects;
using Rotempco.BaseClass.Objects.Enums;

namespace Rotempco.Website.Objects
{
    public class PublicSessionStore
    {
        #region [ Singleton Constructor ]

        static readonly PublicSessionStore _Instance = new PublicSessionStore();

        static PublicSessionStore()
        {
        }

        private PublicSessionStore()
        {
        }

        public static PublicSessionStore Instance
        {
            get
            {
                if (HttpContext.Current.Session["PublicSessionStore"] == null)
                    HttpContext.Current.Session["PublicSessionStore"] = new PublicSessionStore();

                return HttpContext.Current.Session["PublicSessionStore"] as PublicSessionStore;
            }
        }

        #endregion

        public string PublicUserKeyHash { get; set; }
        public LanguageTypeEnum LanguageType { get; set; }
        public int? CaptchaResult { get; set; }
        
        internal void Clear()
        {
            HttpContext.Current.Session["PublicSessionStore"] = null;
        }


    }
}